package com.stylefeng.guns.core.jms;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import com.stylefeng.guns.core.util.Queue.MyBlockingQueue.Basket;
  
@Component  
public class Consumer { 
	final Basket basket = new Basket();
        // 使用JmsListener配置消费者监听的队列，其中text是接收到的消息  
	@JmsListener(destination = "roomPeople.topic",containerFactory = "jmsListenerContainerTopic")  
    public void receiveTopic(String roomPeopleStr) { 
		roomPeopleStr=roomPeopleStr.replaceAll("\"", ""); 
        try {
        	basket.produce(roomPeopleStr);
        	//ClmMonitoringController.updateMap();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }  
	
    @JmsListener(destination = "mytest.queue",containerFactory = "jmsListenerContainerQueue")  
    public void receiveQueue(String text) {  
        System.out.println("Consumer111 queue收到的报文为:"+text);  
    }  
    
    
} 
